package com.situ.day7;

//在Java里面如果一个类没有继承任何一个类，默认继承Object
public class Person extends Object{
    protected int id;
    protected String name;
    protected int age;

    //构造方法重载
    public Person() {
        super();
    }

    public Person(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public Person(int id, String name, int age) {
        //super();
        this.id = id;
        this.name = name;
        this.age = age;
    }

    //方法重载：同一个类里面，方法名相同，参数类型或者个数不一样，
    //和返回值没有关系
    public void show() {
        System.out.println("Person.show");
    }

//    public int show(int id) {
//        return 0;
//    }
//
//    void show(int a, char b, double c){
//
//    }

    //'show(int, char, double)' is already defined in 'com.situ.day7.Person'
//    double show(int x, char y, double z){
//        return 0.0;
//    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
